import axios from "../service/index";
import React, { useEffect, useState } from "react";
import WelcomeSon from "./Wel";

export default function Welcome() {
  let [list, setList] = useState([]);
  useEffect(() => {
    axios.get("/api/usersatistics/getData").then((res) => {
      console.log(res);
      setList(res.data);
    });
  }, []);
  return (
    <div className="boxEac">
      <WelcomeSon id="main1" list={list.gender}></WelcomeSon>
      <WelcomeSon id="main2" list={list.accessFrom}></WelcomeSon>
      <WelcomeSon id="main3" list={list.area}></WelcomeSon>
      <WelcomeSon id="main4" list={list.gender}></WelcomeSon>
    </div>
  );
}
